<!DOCTYPE HTML>
<html>
<head>
<include file="Public:head" />
<css file="__STATIC_CSS__/validate.css" />
<script src="__PUBLIC__/Static/js/validate/jquery.validateid.js"></script>

</head>

<body>
<include file="Public:header" />


<script type="text/javascript">
$(document).ready(function() {
	
	var validator = $("#signupform").validate({
		onkeyup: false,
		rules:{
			email: {
				required: true,
				email: true,
				remote: "{:U('checkUser',array('t'=>'email'))}"
			},
			password: {
				required: true,
				minlength: 6
			},
			repassword: {
				required: true,
				minlength: 6,
				equalTo: "#password"
			},
			username:{
				required: true,
				minlength: 2,
				maxlength: 12,
				remote:"{:U('checkUser',array('t'=>'username'))}"
			}
		},
		messages: {
			email: {
					required: "请输入Email地址",
					email: "请输入一个正确的Email地址",
					remote:jQuery.format("Email已经存在，请更换其他Email")
			},
			password: {
				required: "请输入密码",
				minlength: jQuery.format("至少输入6个字符")
			},
			repassword: {
				required: "请重复输入密码",
				minlength: jQuery.format("两次输入密码不一致"),
				equalTo: "两次输入密码不一致"
			},
			username:{
				required:"请输入用户名",
				minlength: jQuery.format("至少输入2个字符"),
				maxlength: jQuery.format("最多输入12个字符"),
				remote:jQuery.format("用户名已经存在，请更换其他用户名")
			}
		},

		// the errorPlacement has to take the table layout into account
		errorPlacement: function(error, element) {
			if ( element.is(":radio") )
				error.appendTo( element.parent().next().next() );
			else if ( element.is(":checkbox") )
				error.appendTo ( element.next() );
			else
				error.appendTo( element.parent().next() );
		},

		success: function(label) {
			// set &nbsp; as text for IE
			label.html("&nbsp;").addClass("checked");
		}
	});

});
</script>


<!--main-->
<div class="midder">
<div class="mc">
<div class="user_tit" style="height:60px; font-size:14px; margin-bottom:10px">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="60"><img src="{$user[face]}" width="50" height="50"/></td>
    <td style="line-height:22px; padding-top:5px" valign="top">
    	<p>亲爱的 {$user ['keyname']}</p>
        <if condition="$user[type] eq 'qq'">
    	<p>欢迎通过 <img src="__PUBLIC__/Static/images/connect_qq.png"/> 来到爱客网！</p>
        </if>
        <if condition="$user[type] eq 'sina'">
        <p>欢迎通过 <img src="__PUBLIC__/Static/images/connect_sina_weibo.png"/> 来到爱客网！</p>
        </if>
    </td>
  </tr>
</table>
</div>

<div class="user_left">
<p class="pl2">&gt; 没有爱客网账号？填写资料马上拥有！</p>
<form  id="signupform" method="POST" action="{:U('home/user/binding')}">
<table width="100%" border="0" cellspacing="0" cellpadding="0"  class="Tabletext">

<tr>
<td class="label"><label id="email" for="email">Email：</label></td>
<td class="field" width="300">
<input class="uinput" id="email" name="email" type="email" value="" placeholder="请输入Email" autofocus/></td>
<td class="status"></td>
</tr>

<tr>
<td class="label"><label>密码：</label></td>
<td class="field"><input class="uinput" type="password" id="password" name="password"  style="width:250px"/></td>
<td class="status"></td>
</tr>
<tr>
<td class="label"><label>重复密码：</label></td>
<td class="field"><input class="uinput" type="password" id="repassword" name="repassword"  style="width:250px"/></td>
<td class="status"></td>
</tr>

<tr>
<td class="label"><label>用户名：</label></td>
<td class="field"><input class="uinput" type="text" id="username" name="username" value="{$user ['ik_user_name']}"/></td>
<td class="status"></td>
</tr>

<tr>
<td class="label"></td>
<td class="field">
<input class="submit" type="submit" value="好了，保存吧" style="margin-top:8px"/> 
</td>
<td class="status"></td>
</tr>

<tr>
<td class="label"><br /></td>
<td class="field"><br /></td> 
<td class="status"></td>
</tr>

</table>
</form>
</if>
</div>
<div class="aside">     
<p class="pl2">&gt; 已有爱客网帐号？马上绑定！</p>
<form  id="signupform" method="POST" action="{:U('home/user/binduser')}">

<table width="100%" border="0" cellspacing="0" cellpadding="0"  class="Tabletext">

<tr>
<td class="label"><label id="ikemail" for="ikemail">爱客网Email：</label></td>
<td class="field" width="300">
<input class="uinput" id="ikemail" name="ikemail" type="email" value="" placeholder="请输入Email" autofocus/></td>
<td class="status"></td>
</tr>

<tr>
<td class="label"><label>登录密码：</label></td>
<td class="field"><input class="uinput" type="password" id="ikpassword" name="ikpassword"/></td>
<td class="status"></td>
</tr>

<tr>
<td class="label"></td>
<td class="field">
<input class="submit" type="submit" value="好了，保存吧" style="margin-top:8px"/> 
</td>
<td class="status"></td>
</tr>

<tr>
<td class="label"><br /></td>
<td class="field"><br /></td> 
<td class="status"></td>
</tr>

</table>
</form>

</div>


<div class="cl"></div>

</div>
</div>
<include file="Public:footer" />
</body>
</html>